<?php 
include("database.php");

    $user = $_POST['Username']; 
    $pass = $_POST['Password']; 
    $sql = mysqli_query($con,"SELECT * FROM Users WHERE Username='$user' AND Password='$pass' LIMIT 1"); 
    if(mysqli_num_rows($sql) == 1){ 
        $row = mysqli_fetch_array($sql); 
        session_start();
        $_SESSION['Username'] = $row['Username'];
        $_SESSION['logged'] = TRUE; 
        header("Location: ../index.php");
        exit; 
    }
?>